package cn.wzptsoft.tinymallbe.controller;

import cn.wzptsoft.common.utils.Result;
import cn.wzptsoft.tinymallbe.entity.Poster;
import cn.wzptsoft.tinymallbe.entity.Theme;
import cn.wzptsoft.tinymallbe.service.PosterService;
import cn.wzptsoft.tinymallbe.service.ThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("poster")
@Validated
public class PosterController {
    @Autowired
    private PosterService posterService;

//    查找制定的广告
    @GetMapping("/name/{name}")
    public Result<Poster> getByName(
            @PathVariable @NotBlank String name){
        Poster poster= posterService.getByName(name);
        return Result.ok(poster);
    }
}
